/*
 * @Description: Webpack 代理请求地址
 * @Author: 0001100986/LiuShuai
 * @Date: 2021-06-22 14:09:49
 * @LastEditTime: 2021-11-19 10:53:06
 * @LastEditors: 0001100986/LiuShuai
 */
const path = require('path');
const ip = process.env.NODE_ENV === 'development' ? '192.168.0.205' : '127.0.0.0.1';

module.exports = {
  contentBase: path.resolve(__dirname, 'dist'),
  host: '127.0.0.1',
  port: 3000,
  compress: true,
  proxy: {
    '/uapApi': {
      target: 'http://' + ip + ':32001',
      xfwd: true,
      changeOrigin: true,
      pathRewrite: {
        '^/uapApi': ''
      },
    },
    '/stomp': {
      target: 'http://' + ip + ':32001',
      ws: true
    },
    '/telnetssh': {
      target: 'https://' + ip + ':28001',
      ws: true,
      secure: false
    }
  },
  historyApiFallback: true,
  progress: true,
  hot: true,
  disableHostCheck: true,
  inline: true,
  staticOptions: {
    maxAge: 365 * 24 * 3600 * 1000,
  }
};